package com.mujin.keji.collectionsystem.common;

/**
 * 外访房屋
 */
public enum VisitHouseEnum {
    own_home("own_home","小区私人住宅"),
    not_own_home("not_own_home","无小区私人住宅"),
    company_dormitory("company_dormitory","公司宿舍"),
    farmer_homer_ente("farmer_homer_ente","农民房出租"),
    company_home("company_home","公司住宅"),
    office_building("office_building","写字楼"),
    factory("factory","工厂"),
    shop("shop","店铺")
    ;

    /** 状态码 **/
    private final String code;
    /** 状态描述 **/
    private final String description;

    VisitHouseEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public static String find(Integer origin) {
        if(origin == null){
            return null;
        }
        for (VisitHouseEnum frs : VisitHouseEnum.values()) {
            if ((frs.ordinal()+1) == origin) {
                return frs.getCode();
            }
        }
        return null;
    }
    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
